enhance test_encoding to check gbfile gzapi.
authortsteven4 <tsteven4@gmail.com>
Fri, 10 Nov 2017 14:25:14 +0000 (07:25 -0700)
committertsteven4 <tsteven4@gmail.com>
Fri, 10 Nov 2017 14:25:14 +0000 (07:25 -0700)
test_encoding

index 44d9b49c478408778f3dd4b1d4880405461fb97f..5a374510a168a682216985ba7f53d07b64b6141a 100755 (executable)
@@ -13,31 +13,41 @@ errorcount=0
 
 if  locale -a | grep -q en_US.iso88591 ; then
   export LC_ALL=en_US.iso88591
-  rm -f ${TMPDIR}/file*.kml
-  rm -f ${TMPDIR}/file*.gpx
 
 # test input file name mangling
-  cp ${REFERENCE}/bounds-test.gpx ${TMPDIR}/file¢.gpx
-  ${PNAME} -i gpx -f ${TMPDIR}/file¢.gpx -o kml -F ${TMPDIR}/fileo.kml || {
+  rm -f ${TMPDIR}/test_encoding_file*
+  cp ${REFERENCE}/bounds-test.gpx ${TMPDIR}/test_encoding_file¢.gpx
+  ${PNAME} -i gpx -f ${TMPDIR}/test_encoding_file¢.gpx -o kml -F ${TMPDIR}/test_encoding_fileo.kml || {
     echo "ERROR: The input file name was mangled."
     errorcount=`expr $errorcount + 1`
   }
 
 # test output file name mangling
-  ${PNAME} -i gpx -f ${REFERENCE}/bounds-test.gpx -o kml -F ${TMPDIR}/file¢.kml
-  count=$(ls -1 -l ${TMPDIR}/file¢.kml | wc -l)
+  rm -f ${TMPDIR}/test_encoding_file*
+  ${PNAME} -i gpx -f ${REFERENCE}/bounds-test.gpx -o kml -F ${TMPDIR}/test_encoding_file¢.kml
+  count=$(ls -1 -l ${TMPDIR}/test_encoding_file¢.kml | wc -l)
   if [ $count -lt 1 ]; then
     echo "ERROR: The output file name was mangled."
     errorcount=`expr $errorcount + 1`
   fi
 
 # test output file name mangling using a format that uses gbfile
-  ${PNAME} -i gpx -f ${REFERENCE}/bounds-test.gpx -o unicsv -F ${TMPDIR}/file¢.csv
-  count=$(ls -1 -l ${TMPDIR}/file¢.csv | wc -l)
+  rm -f ${TMPDIR}/test_encoding_file*
+  ${PNAME} -i gpx -f ${REFERENCE}/bounds-test.gpx -o unicsv -F ${TMPDIR}/test_encoding_file¢.csv
+  count=$(ls -1 -l ${TMPDIR}/test_encoding_file¢.csv | wc -l)
   if [ $count -lt 1 ]; then
     echo "ERROR: The output file name was mangled."
     errorcount=`expr $errorcount + 1`
   fi
+
+# test input file name mangling using a format that uses gbfile with the gzapi
+  rm -f ${TMPDIR}/test_encoding_file*
+  cp ${REFERENCE}/sample.gtm.gz ${TMPDIR}/test_encoding_file¢.gtm.gz
+  ${PNAME} -i gtm -f ${TMPDIR}/test_encoding_file¢.gtm.gz -o gpx -F ${TMPDIR}/test_encoding_fileo.gpx || {
+    echo "ERROR: The input file name was mangled."
+    errorcount=`expr $errorcount + 1`
+  }
+
 else
   echo "$0 cannot run without the en_US.iso88591 locale."
 fi